package cn.iocoder.yudao.module.api.promotion.combination.enums;

import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 拼团状态枚举
 *
 * @author HUIHUI
 */
@AllArgsConstructor
@Getter
public enum CombinationRecordStatusEnum implements EnumValuable {

    IN_PROGRESS(0, "进行中"),
    SUCCESS(1, "拼团成功"),
    FAILED(2, "拼团失败");

    @EnumValue
    private final Integer value;
    private final String name;

    public static boolean isSuccess(Integer status) {
        return ObjectUtil.equal(status, SUCCESS.getValue());
    }

    public static boolean isInProgress(Integer status) {
        return ObjectUtil.equal(status, IN_PROGRESS.getValue());
    }

    public static boolean isFailed(Integer status) {
        return ObjectUtil.equal(status, FAILED.getValue());
    }

}
